#pragma once
#include "SGD Wrappers/tinyxml.h"
#include "Tile.h"
#include "windows.h"
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include <vector>
using std::vector;

class CGame;
class CTileManager
{
public:
	CTileManager					(void);
	~CTileManager					(void);
	bool LoadTile					(vector<CTile>& vTiles, vector<CTile>& vCollision, vector<CTile>& vEvents, const char* szFilename);
	void Render						(vector<CTile>const &Tiles);
	RECT CellAlgorithm				( int ID );
	RECT CellDestinationAlgorithm	(CTile pTile);

	void SetTileWidth			(int cW) { m_nTileWidth = cW; }
	void SetTileHeight			(int cH) { m_nTileHeight = cH; }
	int GetTileWidth			(void) const { return m_nTileWidth; }
	int GetTileHeight			(void) const { return m_nTileHeight; }
	void SetTilePixelWidth		(int tPW) { m_nTilePixelWidth = tPW; }
	int	GetTilePixelWidth		(void) const { return m_nTilePixelWidth; }
	void SetTilePixelHeight		(int tPH) { m_nTilePixelHeight = tPH; }
	int GetTilePixelHeight		(void) const { return m_nTilePixelHeight; }

	void SetImageID				(int Id) { m_nImageID = Id; }
	int GetImageID				(void) const { return m_nImageID; }

	int GetSizeX				(void) const { return m_nSizeX; } 
	int GetSizeY				(void) const { return m_nSizeY; }
	void SetSizeX				(int sX) { m_nSizeX = sX; }
	void SetSizeY				(int sY) { m_nSizeY = sY; }

private:

	int						m_nScreenWidth;
	int						m_nScreenHeight;
	int						m_nTilePixelWidth;
	int						m_nTilePixelHeight;
	CSGD_Direct3D*			m_pD3D;
	CSGD_TextureManager*	m_pTM;
	int						m_nTileWidth;
	int						m_nTileHeight;
	int						m_nImageID;
	int m_nSizeX;
	int m_nSizeY;
};

